<template>
<view class="page2">
    <!-- 展示二维码 -->
    <view class="panbel">
        <view class="title">抖音授权账号</view>
        <image :src="qrCodeImg" class="qrCode" :showMenuByLongpress="true"/>
        <view class="tip1">请截图本页或长按图片保存到手机</view>
        <view class="tip1">并打开<text class="blue">抖音APP</text>识别二维码完成抖音授权</view>
        <!-- <button class="btn-blue saveImg">保存二维码</button> -->
    </view>
</view>
</template>
  
<script setup>
import { ref, onBeforeMount } from "vue";
import { useUserStore } from "@/stores";
import { storeToRefs } from "pinia";
// import QR from 'qrcode-base64'
import QR from '@/utils/qrcode2.js';
import "./index.scss";

const { tiktok } = storeToRefs(useUserStore());
const qrCodeImg = ref("");

onBeforeMount(() => {
    qrCodeImg.value = QR.drawImg(tiktok.value.dy_link||'http://www.baidu.com/asfasfasfasfsafasf32332esasdsdgsdgsdgsdgsdgsgs', {
      size: 140
    })
});
</script>
  